package com.yuexun.beilunpatient.ui.registration.adapter;

import android.widget.AbsListView;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.yuexun.beilunpatient.R;
import com.yuexun.beilunpatient.ui.registration.bean.AppointmentHospitalBean;

import org.kymjs.kjframe.widget.AdapterHolder;
import org.kymjs.kjframe.widget.KJAdapter;

import java.util.Collection;

/**
 * Created by chenss on 2018/10/29.
 */
public class RegistrationHosAdapter extends KJAdapter<AppointmentHospitalBean> {

    public RegistrationHosAdapter(AbsListView view, Collection<AppointmentHospitalBean> mDatas, int itemLayoutId) {
        super(view, mDatas, itemLayoutId);
    }

    @Override
    public void convert(AdapterHolder helper, AppointmentHospitalBean item, boolean isScrolling, int position) {
        super.convert(helper, item, isScrolling, position);
        helper.setText(R.id.hos_name, item.getHospital_name());
        helper.setText(R.id.hos_address, item.getHospital_address());
        ImageView hos_pic = (ImageView) helper.getView(R.id.hos_pic);
        Glide.with(mCxt).load(item.getHospital_picture()).into(hos_pic);
    }
}
